Your data handler component provides a number of functions that applications can use to manage their connections to your handler. The most important among these is DataHTask , which provides processor time to your handler. Applications should call this function often so that your handler has enough time to do its work.
Applications may call your handler's DataHPlaybackHints function in order to provide you with some guidelines about how those applications play to use the current data reference.
The DataHFlushData and DataHFlushCache functions allow applications to influence how your component manages its stored data.
For more information on managing data handlers, see "Managing the Data Handler" .
Client programs call your component's DataHTask function in order to cede processor time to your data handler.
pascal ComponentResult DataHTask (DataHandler dh);
This function is essentially analogous to the Movie Toolbox's MoviesTask function. Client programs call this function in order to give your data handler component time to do its work. Your data handler uses this time to do its work. Because client programs will call this function frequently, and especially so during movie playback or capture, your data handler should return control quickly to the client program.
Your component discards the contents of any cached read buffers.
pascal ComponentResult DataHFlushCache (DataHandler dh);
Client programs may call this function if they have, in some way, changed the container associated with the current data reference on their own. Under these circumstances, data your component may have read and cached in anticipation of future read requests from the client may be invalid.
Note that this function does not invalidate any queued read requests (made by calling your component's DataHScheduleData function).
Your component forces any data in its write buffers to be written to the device that contains the current data reference.
pascal ComponentResult DataHFlushData (DataHandler dh);
This function is essentially analogous to the File Manager's PBFlushFile function. The client program may call this function after any write operation (either DataHPutData or DataHWrite ). Your component should do what is necessary to make sure that the data is written to the storage device that contains the current data reference.
The DataHPlaybackHints function allows the client program to provide additional information to your component that you may use to optimize the operation of your data handler.
pascal ComponentResult DataHPlaybackHints (
DataHandler dh,
long flags,
unsigned long minFileOffset,
unsigned long maxFileOffset,
long bytesPerSecond);
| Previous | Chapter Contents | Chapter Top | Next |